<?php
/**
 * Created by PhpStorm.
 * User: qhzhyt
 * Date: 2018/10/11
 * Time: 0:32
 */

require_once '../conf/conf.php';

$record_path = '../files/upload/record/100000_10000_3d7a51.rec';
if (isset($_GET['recordId'])) {
    $record = $db->get('play_record', '*', ['record_id' => $_GET['recordId']]);
    if ($record) {
        $record_path = '../files/upload/record/' . $record['map_id'] . /*'_' . $record['user_id'] .*/ '_' . substr($record['record_hash'], 0, 6) . '.rec';
    }
}

if (!file_exists($record_path)) {
    $record_path = '../files/upload/record/100000_10000_3d7a51.rec';
}

echo file_get_contents($record_path);